/* Integration points (quadratures)
   Jukka Toivanen, Jan Stebel
*/

#include "nclinpoint.h"



template<>
void NCLinPoint<3>::setSF()
{
  SF(0,0) = 1-3*ksi[2];
  SF(1,0) = 1-3*ksi[1];
  SF(2,0) = 1-3*ksi[0];
  SF(3,0) = -2+3*(ksi[0]+ksi[1]+ksi[2]);
}

template<>
void NCLinPoint<3>::setGSF()
{
  GSF(0,0) = 0;
  GSF(0,1) = 0;
  GSF(0,2) = -3;
  GSF(0,3) = 3;
  GSF(1,0) = 0;
  GSF(1,1) = -3;
  GSF(1,2) = 0;
  GSF(1,3) = 3;
  GSF(2,0) = -3;
  GSF(2,1) = 0;
  GSF(2,2) = 0;
  GSF(2,3) = 3;
}


template<>
inline int NCLinPoint<3>::mapDof(int elem, int dof)
{
	return imesh->getVolumeChildNo(elem, dof);
}

template<>
inline int NCLinPoint<3>::getMeshNdof()
{
	return imesh->getNfaces();
}



template<>
void NCLinPoint<2>::setSF()
{
  SF(0,0) = 1-2*ksi[1];
  SF(1,0) = 1-2*ksi[0];
  SF(2,0) = -1+2*(ksi[0]+ksi[1]);
}


template<>
void NCLinPoint<2>::setGSF()
{
  GSF(0,0) = 0;
  GSF(0,1) = -2;
  GSF(0,2) = 2;
  GSF(1,0) = -2;
  GSF(1,1) = 0;
  GSF(1,2) = 2;
}


template<>
inline int NCLinPoint<2>::mapDof(int elem, int dof)
{
	return imesh->getFaceChildNo(elem, dof);
}


template<>
inline int NCLinPoint<2>::getMeshNdof()
{
	return imesh->getNedges();
}



template class NCLinPoint<2>;
template class NCLinPoint<3>;



